#include <iostream>
#include<cstdio>
#include<map>
using namespace std;
int main()
{
  map<char,int>m1;
  char ch;
  while(scanf("%c",&ch))
    if(ch=='\n')break;
    else if(m1.find(ch)==m1.end())
      m1[ch]=1;
    else m1[ch]++;
  while(scanf("%c",&ch))
  if(ch=='\n')break;
    else if(m1.find(ch)!=m1.end())
      if(m1[ch]>1)
        m1[ch]--;
      else m1.erase(m1.find(ch));
    else{
      cout<<ch<<endl;
      exit(0);
    }
    cout<<m1.begin()->first;
  return 0;
}